<?php

/**
 * CelebrityPK form base class.
 *
 * @method CelebrityPK getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCelebrityPKForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'celebrity_pk_id' => new sfWidgetFormInputHidden(),
      'celebrity1_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'add_empty' => true)),
      'celebrity2_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity2'), 'add_empty' => true)),
      'count1_i'        => new sfWidgetFormInputText(),
      'count2_i'        => new sfWidgetFormInputText(),
      'create_time'     => new sfWidgetFormDateTime(),
      'modify_time'     => new sfWidgetFormDateTime(),
      'is_alive_b'      => new sfWidgetFormInputCheckbox(),
      'is_on_top_b'     => new sfWidgetFormInputCheckbox(),
      'system_user_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'add_empty' => true)),
      'count1_mask_i'   => new sfWidgetFormInputText(),
      'count2_mask_i'   => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'celebrity_pk_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('celebrity_pk_id')), 'empty_value' => $this->getObject()->get('celebrity_pk_id'), 'required' => false)),
      'celebrity1_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity'), 'required' => false)),
      'celebrity2_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Celebrity2'), 'required' => false)),
      'count1_i'        => new sfValidatorInteger(array('required' => false)),
      'count2_i'        => new sfValidatorInteger(array('required' => false)),
      'create_time'     => new sfValidatorDateTime(array('required' => false)),
      'modify_time'     => new sfValidatorDateTime(array('required' => false)),
      'is_alive_b'      => new sfValidatorBoolean(array('required' => false)),
      'is_on_top_b'     => new sfValidatorBoolean(array('required' => false)),
      'system_user_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'required' => false)),
      'count1_mask_i'   => new sfValidatorInteger(array('required' => false)),
      'count2_mask_i'   => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('celebrity_pk[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'CelebrityPK';
  }

}
